import { defineComponent } from './ecs';

/**
 * Can't store memory directly in component, ugh
 */
export const VisualMemory = defineComponent('VisualMemory', {});

const memory = new Map();

export const getMemory = (e) => {
  if (!memory.has(e)) {
    memory.set(e, new Map());
  }
  return memory.get(e);
};

export const removeMemory = (e) => {
  memory.delete(e);
}
